package deltadesk.apps.pictureviewer.widget;

import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JComponent;

import deltadesk.apps.pictureviewer.util.DisplayUtil;


public abstract class AbstractWidget extends JComponent {

	private static final long serialVersionUID = 3627342417712181851L;

	
	public AbstractWidget() {
		setFont(new Font("Verdana", Font.PLAIN, 12));
		
		DisplayUtil.hideMouseCursor(this);
	}

	/**
	 * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
	 */
	@Override
	protected void paintComponent(final Graphics g) {
		
		final Graphics2D g2 = (Graphics2D)g;
		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON);
		g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
				RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

		paintComponent(g2);
	}

	protected abstract void paintComponent(final Graphics2D g2);
	
}
